package com.cc.blog.controller;


import com.cc.blog.service.TokenService;
import com.cc.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private TokenService tokenService;

    @GetMapping("/currentUser")
    public Result currentUser(@RequestHeader("Authorization")String token){
        return tokenService.getUserInfoByToken(token);
    }
}
